$LOAD_PATH << File.dirname(__FILE__) + '/../lib/'

require 'flexview'
require 'test/unit'

class TestFlexView < Test::Unit::TestCase
  def test_viewnotfound
    fxv = FlexView::FlexView::new
    
    fxv.configure do |config|
      config[:viewBasePath] = File.dirname(__FILE__)
    end
    
    # Create a filename which does not exist
    filename = '_'
    
    while( File.exists? File.dirname(__FILE__) + '/' + filename)
      filename += '_'
    end
    
    # Try to load not existing view file
    assert_raise(FlexView::ViewNotFoundException) { fxv.createView( '_' ) }
  end
end
